with open("pi_digits") as file_object:
    contents = file_object.read()
    print(contents)
print("========================")

file_path = 'E:/PythonProject/pyprogram/file/pi_digits'
with open(file_path) as file_object:
    contents = file_object.read()
    print(contents)
print("========================")

# 每次一行的方式
filename = 'pi_digits'
with open(filename) as file_object:
    for line in file_object:
        print(line)
print("========================")

filename = 'pi_digits'
with open(filename) as file_object:
    lines = file_object.readlines()

for line in lines:
    print(line.rstrip())
